---
title: 'Using Agenta from CLI'
description: 'Create, experiment, and evaluate your applications all from the CLI'
---

Agenta was designed for use both from the CLI and from the web interface. This guide explains the basics of using Agenta from the CLI. For more details, refer to the [CLI developer guide](/reference/cli/quick-usage).

## Installation
The agenta CLI can be easily installed through pip:
```bash
pip install -U agenta
````

## Creating an application
<Steps>
  <Step title="Create a new project">

To create an application in Agenta, first, initialize an empty project. Run the following command in <Tooltip tip="If you would like to start somewhere you can clone https://github.com/Agenta-AI/simple_prompt">the folder containing your application code</Tooltip>:

```bash
agenta init
``` 

This will prompt you for the project name, the Agenta host, and the API key (if using the cloud or enterprise version).


Running `agenta init` creates a blank project in Agenta and generates a config.toml file in that folder, which contains all the information about your project.

  </Step>
  <Step title="Serve the first app variant">
With the project created, we need to add the first <Tooltip tip="An app variant is one 'version' of an app. It can be created by modifying the code, or the configuration of an existing code base">app variant</Tooltip> to it.
This can be done by running the following command:
    ```bash
    agenta variant serve <filename.py>
    ```

This will create a new app variant in Agenta under the name filename.default. Here, filename is the name of the codebase containing the app logic, while default is a default configuration created for that codebase. Each new app variant created from the web interface or from the CLI will always have the name format `<codebase_name>.<configuration_name>`.

    Running this comand will [create a container for the application](guides/how_does_agenta_work) with a REST API endpoint. This endpoint is what is used by the agenta web interface to communicate with the application.

The CLI will also display the URL of the endpoint, which can be used to test the application.
  </Step>
</Steps>

## Adding a multiple variants for one application

You can add multiple app variants to a single application using the CLI. This is useful if you want to test different workflows for the same application (i.e. single prompt vs. chain of prompts). To do this, create a new python file containing the new logic, then execute the following command:

```bash
agenta variant serve <new_filename.py>

```

In the UI, you'll find the new variant under the same application, labeled `<new_filename>.default`. You can modify the configuration for this variant in the playground and create numerous variants based on it.